﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using AcctrueWMS.Foundation.DAL;
using AcctruePMS.Bll.Common;

namespace AcctruePMS.Bll.Manager
{
    /// <summary>
    /// 获取系统配置信息
    /// </summary>
    public class SettingManager
    {
        //根据key值得到配置项
        public string GetSettingValue(string key)
        {
            return WMSqlExcuter.ExecuteScalar("select  settingValue  from sys_settings where settingKey=@settingKey ",
                CommandType.Text,
                DBFactory.NewParameter("settingKey",key)).ToString();
        }

        public DataTable GetAllSettings()
        {
            return WMSqlExcuter.ExecuteDataTable(string.Format("select settingKey as [key],settingValue as [value]  from sys_settings"));
        }
    }
}
